package com.jeomo.mem.starter.service;

import com.jeomo.mem.starter.dto.MemberPointActivityDto;
import com.jeomo.mem.starter.entity.MemberPointsActivityExe;
import com.jeomo.mem.starter.entity.MemberPointsActivityRule;
import com.jeomo.mem.starter.entity.MemberPointsActivityRuleList;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 会员积分活动服务
 * @author:Jackpot
 * @create 2020-09-04 14:59
 * @description:
 */
public interface IMemPointsActivityRuleService {

    /**
     * 保存积分规则 :新增/修改
     * @param memberPointsActivityRule
     * @param memberPointsActivityRuleLists
     */
    int saveRule(MemberPointsActivityRule memberPointsActivityRule, List<MemberPointsActivityRuleList> memberPointsActivityRuleLists);


    /**
     * 保存积分规则 :新增/修改
     * @param memberPointsActivityRule
     * @param memberPointsActivityRuleLists
     * @param addOrUpdate true 为新增,false 为修改
     * @return
     */
    int saveRule(MemberPointsActivityRule memberPointsActivityRule, List<MemberPointsActivityRuleList> memberPointsActivityRuleLists, boolean addOrUpdate);

    /**
     * 新增积分规则明细
     * @param memberPointsRuleList
     * @param ruleCode    规则ID
     * @return
     */
    int insertRuleDetail(List<MemberPointsActivityRuleList> memberPointsRuleList, String ruleCode);


    /**
     * 删除积分规则
     * @param ruleCode
     * @return
     */
    int deleteRule(String ruleCode);



    /**
     * 删除积分规则明细
     * @param ruleCode 规则ID
     * @return
     */
    int deleteRuleDetail(String ruleCode);

    /**
     * 获取一条会员积分规则的详情信息
     * @param ruleCode
     * @return
     */
    MemberPointActivityDto getMemberPointRule(String ruleCode);



    /**
     * 计算出符合要求的积分活动
     *
     * @param levelCode 会员等级
     * @param goodsCode 消费的商品编码
     * @param amount    消费金额
     * @return
     */
    Map<String, MemberPointsActivityExe> getActivities(String levelCode, String goodsCode, double amount, Date handleDate);

}
